package demo7;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class Demo {
    public static void main(String[] args) {
        System.out.println("初始化开始");
        AnnotationConfigApplicationContext context
                =new AnnotationConfigApplicationContext("demo7");
        System.out.println("初始化完成");
        Person person=context.getBean(Person.class);
        person.play();
        System.out.println("容器准备关闭");
        context.close();
        System.out.println("容器已关闭");
    }
}
